/**
 * 
 */
package observers;

import observers.observers.impl.WeatherDisplayer1;
import observers.observers.impl.WeatherDisplayer2;
import observers.observers.impl.WeatherSpeaker1;
import observers.observers.impl.WeatherSpeaker2;
import observers.subject.impl.WeatherData;

/**
 * @author hoannguyen
 *
 */
public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		WeatherData weatherData;
		weatherData = new WeatherData();
		
		/**
		 * Declare and register Observers
		 */
		WeatherDisplayer1 displayer1 = new WeatherDisplayer1(weatherData);
		WeatherDisplayer2 displayer2 = new WeatherDisplayer2(weatherData);
		WeatherSpeaker1 speaker1 = new WeatherSpeaker1(weatherData);
		WeatherSpeaker2 speaker2 = new WeatherSpeaker2(weatherData);
		
		weatherData.setDataValue("data 1");

		/**
		 * Unregister observers
		 */
		weatherData.unregisterObserver(speaker1);
		weatherData.unregisterObserver(speaker2);
		weatherData.unregisterObserver(displayer1);
		weatherData.unregisterObserver(displayer2);
		weatherData.setDataValue("data 2");
	}
}
